-
Notifications
You must be signed in to change notification settings - Fork 68
LG-4899: getLgIds #2786
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LG-4899: getLgIds #2786
Conversation
🦋 Changeset detectedLatest commit: b556bca The changes in this PR will be included in the next version bump. This PR includes changesets to release 84 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Size Change: +2.17 kB (+0.12%) Total Size: 1.85 MB
ℹ️ View Unchanged
|
@@ -26,7 +26,7 @@ describe('CopyButton', () => { | |||
return render( | |||
<CodeContextProvider | |||
// @ts-expect-error - other ids are missing but not needed for test | |||
lgids={{ | |||
lgIds={{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this testing that a copyButton
with a non-default id can still be queried?
export const DEFAULT_LGID_ROOT = 'lg-button'; | ||
|
||
export const getLgIds = (root: `lg-${string}` = DEFAULT_LGID_ROOT) => { | ||
export const getLgIds = (root: LgIdString = DEFAULT_LGID_ROOT) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessary here, but it might be worth creating a GetLgIdsFunction
function type, and maybe a return type?
type GetLgIdsFunction = (root?: LgIdString) => {
root: LgIdString,
...
}
@shaneeza this should be good to go |
note: a few of these are missing updates to |
✍️ Proposed changes
Updates
data-lgid
anddata-testid
to use scope based test IDs. These test IDs are generated using the helper utilitygetLgIds
. For more information check out the section in the styleguide about getLgIds.🎟 Jira ticket: LG-4899
✅ Checklist
For bug fixes, new features & breaking changes
pnpm changeset
and documented my changesFor new components
🧪 How to test changes